package org.saratogaschools.edd.firefighter.shared.model;

import java.io.Serializable;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(detachable = "true")
public class FireFighter implements Serializable {

	private static final long serialVersionUID = 1L;

	public enum FireFighterRole {
		FIGHTER, CHIEF
	}

	@Persistent
	private FireFighterRole role;

	@PrimaryKey
	private String id;

	@Persistent
	private String departmentKey;
	@Persistent
	private String name;

	public boolean canCheckInToFires() {
		return role == FireFighterRole.FIGHTER;
	}

	public boolean canManageFires() {
		return role == FireFighterRole.CHIEF;
	}

	public String getDepartmentKey() {
		return departmentKey;
	}

	public void setDepartmentKey(String departmentKey) {
		this.departmentKey = departmentKey;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	
	public FireFighterRole getRole() {
		return role;
	}

	public void setRole(FireFighterRole role) {
		this.role = role;
	}

}
